home *** CD-ROM | disk | FTP | other *** search
- Path: mn5.swip.net!usenet
- From: roland.bengtsson@mbox3.swipnet.se (Roland Bengtsson)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Help with an easy C issue.
- Date: 14 Jan 1996 10:46:44 GMT
- Organization: -
- Message-ID: <1068.6586T1130T1296@mbox3.swipnet.se>
- References: <737.6585T1284T2078@in.net> <19960113.44C1D0.3D32@ak056.du.pipex.com>
- NNTP-Posting-Host: dialup101-052.swipnet.se
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
-
- >: I have a value entered as a string like,
- >:
- >: char *mystring;
- >:
- >: printf("Enter your age>");
- >: scanf("%s",&mystring);
- >:
- >: Now I want it to be an int, so:
- >:
- >: myint=atoi(mystring);
- >:
- >: I mess around with the int:
- >:
- >: myint=myint+10;
- >:
- >: And I want to turn myint back into a string.
-
- sprintf(mystring,"%d",myint);
-
- Short, isn't it :-)
- --
- \|/
- Thor 2.22 @ @
- +--------------------------oOO-(_)-OOo----------+
- |Amigaowner | |
- |since 1988 | |
- | _ |Fidonet> 2:203/802.6 |
- | _ // | |
- | \X/ |Falkenberg, Westcoast of Sweden |
- |A3000/10MB | |
- |280HD/28.8 |Please write where YOU live! |
- |GVP Spectrum| |
- +------------+----------------------------------+
- AMIGA - Multimedia, Preemptive Multitasking
- Plug'n'Play since 1985.
- PGP-key Available
-
-